$(function() {
    if ($('.image-editor').length > 0) {
        $('.image-editor').cropit({
            imageState: {
                src: 'http://fe.com/images/show.jpg'
            }
        });
    }

    $('.conform').click(function() {
        var imageData = $('.image-editor').cropit('export');
        b64 = imageData.substring(22);

        $.post("${ctxPath}/img/changeHead", {
                content: b64
            },
            function(data, status) {
                if (data.status == true) {
                    $('#checkInfo').hide('fast');
                } else {
                    $('#checkInfo').hide('fast');
                }
            });

    });

});
